<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
>
<head>
    <meta charset="UTF-8"/>
    <title>Insert title here</title>
</head>
<body>
<div>
    <h1>2.	实现上传文件</h1>
    <table border="1">
        <tr>
            <td>文件名</td>
            <td>路径</td>
            <td>操作</td>
        </tr>
        <tr th:each="file,index:${fileList}">
            <td th:text="${file.getFileName()}"></td>
            <td th:text="${file.getSrc()}"></td>
            <td><a th:href="@{'/dowload'(id=${file.getFileName()})}">下载</a></td>
        </tr>
    </table>
    <h1>3.	实现下载文件</h1>
    <table>
        <tr>
            <th>
                <form style="text-align: center" action="/fileUpload" method="post" enctype="multipart/form-data">
                    <input type="file" name="fileName" multiple="multiple">
                    <input type="submit" value="提交">
                </form>
            </th>
        </tr>
    </table>
</div>
<script th:inline="javascript">
    var msg = [[${msg}]];
    if (msg != null && msg.length > 0) {
        alert(msg);
    }
</script>
</body>
</html>
